<?php


namespace app\admin\controller;


use app\admin\model\LoginLog as  LoginLogModel;
use app\common\controller\AdminController;
use think\Exception;

class LoginLog extends AdminController {

    protected $levelConfig = [
        1 => ['getlist'],
        2 => [],
        4 => [],
        8 => []
    ];

    /**
     * 列表
     * @return false|string
     * @throws \MongoDB\Driver\Exception\Exception
     */
    public function getList(){
        try {
            $params = $this->checkParams('page,long');
            if ($params === false) return $this->resErr();
            $list = LoginLogModel::getList($params);
            return $this->resData('success', $list);
        } catch (Exception $e) {
            return $this->resErr($e->getMessage(), $e->getCode());
        }
    }

}